package cn.z2huo.knowledge.basic.number.$double;

import cn.hutool.core.util.NumberUtil;

/**
 * <p>
 *
 * @author z2huo
 */
class DoubleFormat {

    public static void main(String[] args) {

        Double a = Double.valueOf("0.333456");
        System.out.println(a.longValue());
        System.out.println(a.shortValue());
        System.out.println(a.intValue());
        System.out.println();

        System.out.println(NumberUtil.decimalFormat("#", 0));
        System.out.println(NumberUtil.decimalFormat("#0.000", 0.333456));
        System.out.println(NumberUtil.decimalFormat("0.000", 0.333456));
        System.out.println(NumberUtil.decimalFormat("#0.000", 1.333456));
        System.out.println(NumberUtil.decimalFormat("000.000", 1.333456));
        System.out.println(NumberUtil.decimalFormat("#.000", 1.333456));
        System.out.println(NumberUtil.decimalFormat("#.00000", 1.333456));
        System.out.println(NumberUtil.decimalFormat("#.#", 1.333456));
        System.out.println(NumberUtil.decimalFormat("#.#", 123456.333456));

        System.out.println();

    }

}
